package com.demo;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by
 * spring boot 之初体验
 * @author touni
 * @date 2019/4/8
 * @time 10:44
 */

@RestController
@EnableAutoConfiguration   //自动配置，相当于写了spring的配置文件，一般写在run的方法中
public class HelloController {

    @RequestMapping("/hello/{name}")
    public String sayHello(@PathVariable String name){
        return name;


    }

    public static void main(String[] args) {
        SpringApplication.run(HelloController.class);  //用来开启springboot


    }





}
